﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TraductorAVoz
{
   public class ActionCommand:System.Windows.Input.ICommand
    {

        Action<string, string, string> accion;


        public ActionCommand(Action<string,string,string> action) {
            accion = action;
        
        }

        public bool CanExecute(object parameter)
        {
           return  true;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            var parameters = parameter as List<string>;
            accion.Invoke(parameters[0], parameters[1], parameters[2]);
        }
    }
}
